require 'savon'


def testPHP
  client = Savon.client(wsdl: "http://soadv.ea.intropro.com/soa-infra/services/Content/ProcessHomepagePackage/ProcessHomepagePackage.service?WSDL", namespace: "http://directv.com/Content/Data/ContentMetadata")

  mid = "B000012011"
  session_cat = "session"
  package_cat = "package"
  title_cat = "home_page"
  media1_cat = "background_CNBK1000700012062011"
  
  message = {"tns:MetadataProperties"=> {"MetadataProperty"=>[
                                         {"Name"=>"GeoID", "Category"=>session_cat, "Value"=>"PA"},
                                         {"Name"=>"SessionID", "Category"=>session_cat, "Value"=>"B0004018909"},
                                        
                                         {"Name"=>"BaseMaterialID", "Category"=>package_cat, "Value"=>mid},

                                         {"Name"=>"Asset_Class", "Category"=>title_cat, "Value"=>"home page"},
                                        
                                         {"Name"=>"Asset_Class", "Category"=>media1_cat, "Value"=>"background"},
                                         {"Name"=>"MaterialID_house", "Category"=>media1_cat, "Value"=>mid+"G0"},
                                         {"Name"=>"FileLocationOriginal", "Category"=>media1_cat, "Value"=>"/opt/DIST/CableLabsFiles/dev_provider/original/HPRA_MANUAL_TESTS/B000302108_background.bmp"},
                                         {"Name"=>"FileLocationHouse", "Category"=>media1_cat, "Value"=>"/opt/DIST/CableLabsFiles/dev_provider/house/background/2013_10/B000012011/B000012011G0/B#{Time.now.tv_sec}G0.mpg"},
                                         {"Name"=>"TranscoderParams", "Category"=>media1_cat, "Value"=>"-s ntsc -r ntsc -b:v 50M -maxrate 50M -minrate 50M -bufsize 10M -f mpeg2video -profile:v 1 -pix_fmt yuv420p -q:v 1 -flags +ildct"},
                                         {"Name"=>"Image_Aspect_Ratio", "Category"=>media1_cat, "Value"=>"720x480"},
                                        
#                                          {"Name"=>"StatusCode", "Category"=>media1_cat + "_status_002", "Value"=>"CS_THUMBNAIL_READY"},
                                         {"Name"=>"StatusCode", "Category"=>media1_cat + "_status_019", "Value"=>"CS_COMPLETE_ON_AIR"},
                                         {"Name"=>"StatusCode", "Category"=>media1_cat + "_status_001", "Value"=>"CS_TRANSCODE_READY"},
                                                 
#                                          {"Name"=>"StatusCode", "Category"=>package_cat + "_status_002", "Value"=>"CS_THUMBNAIL_READY"},
                                         {"Name"=>"StatusCode", "Category"=>package_cat + "_status_001", "Value"=>"CS_TRANSCODE_READY"},
                                         {"Name"=>"StatusCode", "Category"=>package_cat + "_status_019", "Value"=>"CS_COMPLETE_ON_AIR"}
                                         ]}}
  

  response = client.call(:process_homepage_package_start, message: message)
  
end

